MWE function error message saying "use of undeclared indentifier" [migrated]
Posted
by
nimbus
on Programmers
See other posts from Programmers
or by nimbus
Published on 2012-10-20T00:32:29Z
Indexed on
2012/10/20
11:19 UTC
Read the original article
Hit count: 159
objective-c
I'm unsure about how to make MWE with Objective C, so if you need anything else let me know.
I am trying running through a tutorial on building an iPhone app and have gotten stuck defining a function. I keep getting an error message saying "use of undeclared indentifier". However I believe I have initiated the function.
In the view controller I have:
if (scrollAmount > 0) {
moveViewUp = YES;
[scrollTheView:YES];
}
else{
moveViewUp = NO;
}
with the function under it
- (void)scrollTheView:(BOOL)movedUp {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
CGRect rect = self.view.frame;
if (movedUp){
rect.origin.y -= scrollAmount;
}
else {
rect.origin.y += scrollAmount;
}
self.view.frame = rect;
[UIView commitAnimations];
}
I have initiated the function in the header file (that I have imported).
- (void)scrollTheView:(BOOL)movedUp;
© Programmers or respective owner